home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 10: University / CDAT10.iso / TUTORIALES.DXR / 00001_Crear Lista.ls next >
Encoding:
Text File  |  1999-10-20  |  1001 b   |  45 lines

  1. global Sec, i, tl, tipo, texto, ListaCP, OpcionesCat, OpcionesSubcat, OpcionesProg, spIdioma, spFormato, colorOpciones
  2.  
  3. on prepareFrame
  4.   Archivo = the pathName & "tutoriales\" & "info.txt"
  5.   importFileInto(member("info"), Archivo)
  6.   InicializarGlobales()
  7.   Sec = 0
  8.   texto = member("info").text
  9.   lineas = texto.lines.count
  10.   repeat with i = 1 to lineas
  11.     tl = texto.line[i]
  12.     case tl.word[1] of
  13.       "*":
  14.         tipo = "S"
  15.         AgregarElemento()
  16.         append(OpcionesCat, Sec)
  17.       "#":
  18.         tipo = "C"
  19.         AgregarElemento()
  20.       "-":
  21.         tipo = "P"
  22.         AgregarElemento()
  23.     end case
  24.   end repeat
  25.   MenuCategorias()
  26.   updateStage()
  27. end
  28.  
  29. on AgregarElemento
  30.   Sec = Sec + 1
  31.   ListaCP[#tipo][Sec] = tipo
  32.   put ListaCP
  33.   ListaCP[#linea][Sec] = i
  34.   delete tl.word[1]
  35.   ListaCP[#titulo][Sec] = tl
  36. end
  37.  
  38. on MenuCategorias
  39.   s = EMPTY
  40.   repeat with r = 1 to OpcionesCat.count
  41.     s = s & ListaCP[#titulo][OpcionesCat[r]] & RETURN
  42.   end repeat
  43.   member("Categorias").text = s
  44. end
  45.